﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AttributeDemo
{
    /// <summary>
    /// the press will check each object and decide how to treat them
    /// </summary>
    public class ThePress
    {
        public static void Print(ISay say)
        {
            System.Reflection.MemberInfo info = say.GetType();
            BlockAttribute att=
                 (BlockAttribute)Attribute.GetCustomAttribute(info, typeof(BlockAttribute));
            if (att.Level == Level.Yes)
                Console.WriteLine(say.GetType().ToString() + ": " + say.Say());
            else
                Console.WriteLine(say.GetType().ToString() + ": " + "I Love the contry!");
        }
    }
}
